<template>
	<view class="pageBg h100">
		<view class="body ">
			<view class="white">
				<u-swiper border-radius="50" effect3dPreviousMargin="50" :list="list" :effect3d="true"></u-swiper>
			</view>
			<view class="jcc w100 white">
				<view style="width: 400rpx;">
					<u-tabs 
					:is-scroll="false"
					name="cate_name_home"
					barWidth="120"
					:list="listtab" 
					:current="currenttabs" 
					@change="changeTabs"></u-tabs>
				</view>
			</view>
			
		</view>
		<!-- 列表 -->
		<view class="jcc fdc aic">
			<view class="" v-show="currenttabs==0" v-for="(item,index) in listTask" :key="index">
				<view class="" @tap="handleSignature(0)">
					<taskCard :item="item"></taskCard>
				</view>
			</view>
		</view>
		
		<view class="my30">
			<u-loadmore :status="status" :load-text="loadText"/>
		</view>
			<view class="" style="height: 50rpx;"></view>
		<!-- 内容 end -->
	</view>
</template>

<script>
	export default {
		name:"indexHome",
		data() {
			return {
				loadText: {
									loadmore: '轻轻上拉',
									loading: '努力加载中',
									nomore: '没有更多了'
								},
									currenttabs:0,//顶部导航
				status: 'loading',//nomore
				
							
				listTask:[],
				listtab: [{
									name: '热门需求'
								}, {
									name: '推荐任务'
								}, ],
				list: [{
										image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
										title: '昨夜星辰昨夜风，画楼西畔桂堂东'
									},
									{
										image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
										title: '身无彩凤双飞翼，心有灵犀一点通'
									},
									{
										image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
										title: '谁念西风独自凉，萧萧黄叶闭疏窗，沉思往事立残阳'
									}
								],
			};
		},
		created() {
			setTimeout(()=>{
				this.listTask=[{
					title:"美工",
					company:"河南中原人力",
					detail:"要求会PS AI C4D",
					commission:"根据实际情况计算工资",
					startDate:"2021-04-13 14:58:58"
				},{
					title:"美工",
					company:"河南中原人力",
					detail:"要求会PS AI C4D",
					commission:"根据实际情况计算工资",
					startDate:"2021-04-13 14:58:58"
				}]
				this.status = "nomore"
			},0)
		},
		methods:{
			handleSignature(e){
				console.log(213);
				this.$emit('handleSignature',e)
			},
			changeTabs(e){
						this.currenttabs=e
					}
		}
	}
</script>

<style lang="scss">

</style>
